package com.crazy.model.major.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

/**
 * <p>
 * 文章，博客
 * </p>
 *
 * @author ${author}
 * @since 2020-12-24
 */
@TableName("T_ARTICLE")
public class TArticle extends Model<TArticle> {

    /**
    * 所有字段名
    */
    public static class Columns {
        /**
        * 
        */
        public static final String id = "ID";
        /**
        * 标题名
        */
        public static final String titleName = "TITLE_NAME";
        /**
        * 文章内容
        */
        public static final String content = "CONTENT";
        /**
        * 类型（1：自创，2：转载）
        */
        public static final String type = "TYPE";
        /**
        * 
        */
        public static final String userId = "USER_ID";
        /**
        * 
        */
        public static final String createTime = "CREATE_TIME";
        /**
        * 
        */
        public static final String updateTime = "UPDATE_TIME";
        /**
        * 是否有效（0：无效，1：有效）
        */
        public static final String valid = "VALID";
        /**
        * 浏览次数
        */
        public static final String readTimes = "READ_TIMES";
        /**
        * 是否公开（0：不公开，1：公开）
        */
        public static final String isPublic = "IS_PUBLIC";
        /**
        * 是否发布（0：不发布，1：发布）
        */
        public static final String isRelease = "IS_RELEASE";
    }

    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 标题名
     */
    @TableField("TITLE_NAME")
    private String titleName;

    /**
     * 文章内容
     */
    @TableField("CONTENT")
    private String content;

    /**
     * 类型（1：自创，2：转载）
     */
    @TableField("TYPE")
    private Integer type;

    @TableField("USER_ID")
    private Long userId;

    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    @TableField("UPDATE_TIME")
    private LocalDateTime updateTime;

    /**
     * 是否有效（0：无效，1：有效）
     */
    @TableField("VALID")
    private Integer valid;

    /**
     * 浏览次数
     */
    @TableField("READ_TIMES")
    private Long readTimes;

    /**
     * 是否公开（0：不公开，1：公开）
     */
    @TableField("IS_PUBLIC")
    private Integer isPublic;

    /**
     * 是否发布（0：不发布，1：发布）
     */
    @TableField("IS_RELEASE")
    private Integer isRelease;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitleName() {
        return titleName;
    }

    public void setTitleName(String titleName) {
        this.titleName = titleName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getValid() {
        return valid;
    }

    public void setValid(Integer valid) {
        this.valid = valid;
    }

    public Long getReadTimes() {
        return readTimes;
    }

    public void setReadTimes(Long readTimes) {
        this.readTimes = readTimes;
    }

    public Integer getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic;
    }

    public Integer getIsRelease() {
        return isRelease;
    }

    public void setIsRelease(Integer isRelease) {
        this.isRelease = isRelease;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "TArticle{" +
        "id=" + id +
        ", titleName=" + titleName +
        ", content=" + content +
        ", type=" + type +
        ", userId=" + userId +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", valid=" + valid +
        ", readTimes=" + readTimes +
        ", isPublic=" + isPublic +
        ", isRelease=" + isRelease +
        "}";
    }
}
